	<script>	
		$(document).ready(function(e) {
        	$("#testid").click(function(){
				var idp=$("#DropDownTimezone").val();						
				//alert(idp);	
				//alert(idp);			
			});
    	});	
	</script> 
     <?php
   	require_once("../action/connection.php");
	include("cmd/cmd.php");
   	$id="";
   	if(isset($_GET['uid']))
		$id=$_GET['uid'];
		$msg="";
		if ($id==0){
			if(isset($_POST['btnsave'])){
				$use=new Users;
				$use->uid=$_POST['txtuser'];
				$use->pwd=$_POST['txtpwd'];
				$use->emp_id=$_POST['cboemp'];				
				
				$msg=$use->new_user();
			
			}
		}else
			if(isset($_POST['btnsave'])){
				$use1=new Users;
				$use1->u_id=$resid;
				$use1->emp_id=$_POST['cboemp'];
				$use1->pwd=$_POST['txtpwd'];
				$use1->uid=$_POST['txtuser'];							
												
				$msg=$use1->update_user();				
			}
			
			
		?>
            <h1 class="page-title"><?php if($id==0)echo"New User"; else echo"Edit User"; ?></h1>
            <div><?php echo $msg; ?></div>
<div class="btn-toolbar">
    <button class="btn btn-primary"><i class="icon-save"></i> Save</button>    
  <div class="btn-group">
  </div>
</div>
<div class="well">
    
    <div id="myTabContent" class="tab-content">
      <div class="tab-pane active in" id="home">
    <form method="post" id="tab">
        <label>Username</label>
        <input name="txtuser" type="text" class="input-xlarge" required>
        <label>Password</label>
        <input name="txtpwd" type="text" class="input-xlarge" required>
        <label>Employee</label>
        <select name="cboemp" name="DropDownTimezone" id="DropDownTimezone" class="input-xlarge">
		<?php 
			require_once("connection.php");
			$query = "SELECT * FROM employee_tbl"; 
			$result = mysql_query($query);	
			while($row = mysql_fetch_array($result)){
		?>        
        	<option value=<?php echo $row['emp_id']; ?>><?php echo $row['emp_name']; ?></option>          
        <?php }?>
        </select>
        <br><button name="btnsave" class="btn btn-primary" id="testid"><i class="icon-save"></i> Save</button> 
            
    </form>
    
      </div>
     </div>
  </div>

